<%@page import="utils.SuperString"%>
<%@page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" trimDirectiveWhitespaces="true" %>
<%@page import="java.util.Date"%>
<%@page import="java.util.List"%>
<%@page import="feedme.dao.*"%>
<%@page import="feedme.bean.*"%>
<%@page import="org.springframework.web.context.support.WebApplicationContextUtils"%>
<%@page import="org.springframework.web.context.WebApplicationContext"%>
<%@page import="utils.SuperString"%>
<%@page import="org.apache.commons.logging.Log" %>
<%@page import="org.apache.commons.logging.LogFactory" %>

<%!
static private Log logger = LogFactory.getLog("foodserver_moddo");
%>

<%
String act = SuperString.notNullTrim(request.getParameter("act"));
String name = SuperString.notNullTrim(request.getParameter("name"));
String tel = SuperString.notNullTrim(request.getParameter("tel"));
String fsId = SuperString.notNullTrim(request.getParameter("fsId"));
String type = SuperString.notNullTrim(request.getParameter("type"));
logger.info("act:" + act);
logger.info("name:" + name);
logger.info("tel:" + tel);
logger.info("fsId:" + fsId);


WebApplicationContext ctx = WebApplicationContextUtils.getWebApplicationContext(request.getServletContext());
DaoFactory daoFactory = ctx.getBean("mongoDaoFactory", DaoFactory.class);
OrderDao dao = daoFactory.getOrderDaoInstance();

if(type.equalsIgnoreCase("fs")){
    if(act.equalsIgnoreCase("add")){
        //检查当日是否有记录，如果有则改为新的
        OrderBean order = dao.findTodayOrder();
        if(order == null){
            dao.createTodayOrder();
        }
        
        dao.selectFoodServer(fsId);
        
        //select food
        logger.debug("order_mod.jsp?act=add&type=food");
        response.sendRedirect("order_mod.jsp?act=add&type=food");
    }

}

%>

操作完成，等待跳转。。。。。。

